package com.cyh.greendaoupgrade.greendao.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.cyh.greendaoupgrade.greendao.model.BookItem2;
import com.cyh.greendaoupgrade.greendao.model.StudentItem;
import com.cyh.greendaoupgrade.greendao.model.TeacherItem;
import com.cyh.greendaoupgrade.greendao.model.UserItem;

import com.cyh.greendaoupgrade.greendao.dao.BookItem2Dao;
import com.cyh.greendaoupgrade.greendao.dao.StudentItemDao;
import com.cyh.greendaoupgrade.greendao.dao.TeacherItemDao;
import com.cyh.greendaoupgrade.greendao.dao.UserItemDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig bookItem2DaoConfig;
    private final DaoConfig studentItemDaoConfig;
    private final DaoConfig teacherItemDaoConfig;
    private final DaoConfig userItemDaoConfig;

    private final BookItem2Dao bookItem2Dao;
    private final StudentItemDao studentItemDao;
    private final TeacherItemDao teacherItemDao;
    private final UserItemDao userItemDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        bookItem2DaoConfig = daoConfigMap.get(BookItem2Dao.class).clone();
        bookItem2DaoConfig.initIdentityScope(type);

        studentItemDaoConfig = daoConfigMap.get(StudentItemDao.class).clone();
        studentItemDaoConfig.initIdentityScope(type);

        teacherItemDaoConfig = daoConfigMap.get(TeacherItemDao.class).clone();
        teacherItemDaoConfig.initIdentityScope(type);

        userItemDaoConfig = daoConfigMap.get(UserItemDao.class).clone();
        userItemDaoConfig.initIdentityScope(type);

        bookItem2Dao = new BookItem2Dao(bookItem2DaoConfig, this);
        studentItemDao = new StudentItemDao(studentItemDaoConfig, this);
        teacherItemDao = new TeacherItemDao(teacherItemDaoConfig, this);
        userItemDao = new UserItemDao(userItemDaoConfig, this);

        registerDao(BookItem2.class, bookItem2Dao);
        registerDao(StudentItem.class, studentItemDao);
        registerDao(TeacherItem.class, teacherItemDao);
        registerDao(UserItem.class, userItemDao);
    }
    
    public void clear() {
        bookItem2DaoConfig.clearIdentityScope();
        studentItemDaoConfig.clearIdentityScope();
        teacherItemDaoConfig.clearIdentityScope();
        userItemDaoConfig.clearIdentityScope();
    }

    public BookItem2Dao getBookItem2Dao() {
        return bookItem2Dao;
    }

    public StudentItemDao getStudentItemDao() {
        return studentItemDao;
    }

    public TeacherItemDao getTeacherItemDao() {
        return teacherItemDao;
    }

    public UserItemDao getUserItemDao() {
        return userItemDao;
    }

}
